package Day02;

/**
 * @author feng
 * @Date 2022/1/1 21:50
 * 字符转换
 */
public class Trans {
    public static void main(String[] args) {
        String s = "张三,李四,王五";
        String[] arr = s.split(",");//张三 李四 王五
        for (String a : arr) {
            System.out.println("人物劫串:" + a);
        }

        //字符串转换成char数组
        char[] chs = s.toCharArray();//张 三 李 四 王 五

        s = "ab你";
        byte[] bytes = s.getBytes();//97 98 -60 -29

        System.out.println("Abc".toUpperCase());//ABC

         //字符替换
        String s1 = "java";
        String s2 = s1.replace("j", "z");//“java”
        System.out.println("s2" + s2);
        System.out.println(s1 == s2);//true

        System.out.println("-" + "    ab  c    ".trim() + "-");//-ab  c-
        //字符的追加
        System.out.println("abc".concat("kkkk")); //abckk
    }
}
